package vip.xiaonuo.core.constant;

import javax.servlet.ServletContext;

/**
 * 通用常量信息
 */
public class Constants {
    public static ServletContext WEB_SERVLET_CONTEXT = null; //该值会在web容器启动时由WebAppContextListener初始化

    public static final int PERPAGE_NUM = 10;
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";
    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "200";
    /**
     * 通用登录成功标识
     */
    public static final Integer LOGINSUCCESS = 0;
    /**
     * 登录失败标识
     */
    public static final Integer LOGINFAIL = 1;
    /**
     * 通用成功标识
     */
    public static final String IMPORT = "211";

    /**
     * 通用未绑定
     */
    public static final String NOTBLIND = "212";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 未登录返回code：702
     */
    public static final String UNLOGIN = "702";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";
    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 自动去除表前缀
     */
    public static String AUTO_REOMVE_PRE = "true";

    /**
     * 当前记录起始索引
     */
    public static String PAGE_NUM = "pageNum";

    /**
     * 每页显示记录数
     */
    public static String PAGE_SIZE = "pageSize";

    /**
     * 排序列
     */
    public static String ORDER_BY_COLUMN = "orderByColumn";

    /**
     * 默认页数
     */
    public static String PAGE_NUM_STR = "1";

    /**
     * 默认一页多少条
     */
    public static String PAGE_SIZE_STR = "10";

    /**
     * 排序的方向 "desc" 或者 "asc".
     */
    public static String IS_ASC = "isAsc";
    public static String DEBUG = "OK";//OK NO

    /**
     * 企业类型
     **/
    public static final String ENTERPISE_TYPE = "E";

    /**
     * 手机号码格式限制
     */
    public static final String MOBILE_REGEX = "^1[0-9]{10}$";

    /** 2020/04/08 start **/
    /**
     * token的前缀
     */
    public static final String PREFIX_USER_TOKEN = "PREFIX_USER_TOKEN_";
    /**
     * 空字符串
     */
    public static final String EMPTY = "";
    /**
     * 默认大小 500K
     */
    public static final long DEFAULT_MAX_SIZE = 5242880;
    /**
     * 文件/视频大小 15M
     */
    public static final long DEFAULT_FILE_MAX_SIZE = 15728640;
    /**
     * 默认的文件名最大长度
     */
    public static final int DEFAULT_FILE_NAME_LENGTH = 200;
    /**
     * 默认文件类型jpg
     */
    public static final String IMAGE_JPG_EXTENSION = ".jpg";
    /**
     * 电话正则表达式
     */
    public static final String REGEX_PHONE = "^[0-9-]{5,20}$";
    /**
     * 数据来源类型pc
     */
    public static final String ORIGIN_TYPE_PC = "pc";
    /**
     * 数据来源类型app
     */
    public static final String ORIGIN_TYPE_APP = "app";
    /**
     * 默认不压缩大小 48K
     */
    public static final long DEFAULT_COMPRESS_SIZE = 49152;
    /**
     * 逗号
     */
    public static final String COMMA = ",";
    /**
     * 分号
     */
    public static final String SEMICOLON = ";";
    /**
     * /profile/
     */
    public static final String FILE_PROFILE = "/profile/";
    /**
     * thunmail/
     */
    public static final String FILE_THUNMAIL = "thunmail/";
    /**
     * /profile/thunmail/
     */
    public static final String FILE_PROFILE_THUNMAIL = "/profile/thunmail/";
    /**
     * 点号
     */
    public static final String POINT = ".";

    /**
     * 点号正则
     */
    public static final String REGEX_POINT = "\\.";
    /**
     * ZhiDaiExcetion
     */
    public static final String ZHIDAI_EXCEPTION = "vip.xiaonuo.core.exception.CommonException: ";

    /**
     * 密码错误计数初始化
     */
    public static final String ERR_COUNT = "1";

    /**
     * 密码错误计数KEY
     */
    public static final String ERR_COUNT_KEY = "count";

    /**
     * 密码错误账号锁定KEY
     */
    public static final String ERR_LOCK_KEY = "lock";

    /**
     * 密码错误账号锁定flag
     */
    public static final String ERR_LOCK_FLAG = "1";

    /**
     * 工程名字
     */
    public static final String PROJECT_NAME = "dcmm";


    /**
     * 项目编号前缀
     */
    public static final String PROJECT_NUMBER_PREFIX = "CESI-DCMM-";


    /**
     * 自增序列开初始值
     */
    public static final String DEFAULT_NUMBER = "001";
    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * sql保存失败
     */
    public static final Integer FAILSQL = 0;

    /**
     * "/"
     */
    public static final String SEPARATOR = "/";

    /**
     * "_"
     */
    public static final String UNDER_LINE = "_";

    /**
     * "-"
     */
    public static final String SHORT_LINE = "-";

    /**
     * ".xlsx"
     */
    public static final String XLSX = ".xlsx";

    /**
     * ".docx"
     */
    public static final String DOCX = ".docx";

    /**
     * ".xls"
     */
    public static final String XLS = ".xls";

    /**
     * 文件大小 1G
     */
    public static final long DEFAULT_ORIGIN_FILE_MAX_SIZE = 1073741824;

    /**
     * 导出文件模板
     */
    public static final String EXCEL_MODEL_PATH = "/excelModel/";

    /**
     * 文件导出地址
     */
    public static final String FILE_STORE_PATH = "/fileStore/";

    /**
     * 文件导出地址
     */
    public static final String DISTRICT = "/district/";

    /**
     * 文件导出地址
     */
    public static final String STREET = "/street/";

    /**
     * 文件导出地址
     */
    public static final String EDUCATION = "/education/";

    /**
     * 文件导出地址
     */
    public static final String HYGIENE = "/hygiene/";

    /**
     * zip
     */
    public static final String ZIP = ".zip";

    /**
     * excelCellDtos
     */
    public static final String EXCEL_CELL_DTO = "excelCellDtos";

    /**
     * 密码正则：6-20位，数字，字母，符号至少两种
     */
    public static final String REGEX_PASSWORD = "^(?![\\d]+$)(?![a-zA-Z]+$)(?![^\\da-zA-Z]+$).{6,20}$";

    /**
     * 密码正则：6-20位，数字，字母，特殊符号( !#$%^&*)至少两种
     */
    public static final String REGEX_SPECIAL_PASSWORD = "^(?![\\d]+$)(?![a-zA-Z]+$)(?![!#$%^&*]+$)[\\da-zA-Z!#$%^&*]{6,20}$";

    /**
     * "0"
     */
    public static final String STR_0 = "0";

    /**
     * "1"
     */
    public static final String STR_1 = "1";

    /**
     * 伦理删除："0"
     */
    public static final String DEL_FLAG_0 = "0";

    /**
     * 伦理删除："1"
     */
    public static final String DEL_FLAG_1 = "1";

    /**
     * 身份证号正则
     */
    public static final String REGEX_IDENTY_NUMBER = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
            "(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";

    /**
     * TYPE
     */
    public static final String STR_TYPE = "type";

    /**
     * 密码隐藏
     */
    public static final String PASSWORD_HIDE = "**********";

    /**
     * 密码校验
     */
    public static final String PASSWORD_CHECK = "^(?![\\d]+$)(?![a-zA-Z]+$)(?![^\\da-zA-Z]+$).{8,16}$";

    /**
     * 两个逗号
     */
    public static final String COMMA_TWO = ",,";

    /**
     * 整数：0
     */
    public static final Long LONG_ZERO = 0L;

    /**
     * sql批量保存数
     */
    public static final int INSERTCOUNT = 20;

    /**
     * sql批量查询数
     */
    public static final int SELECTCOUNT = 300;
    /**
     * 数字正则(最多2位小数)
     */
    public static final String AMT_REGEX = "^-?(([1-9][0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,2}|[1-9][0-9]{0,14}\\.\\d{1,})))$";

    /**
     * 数字正则(无限位小数)
     */
    public static final String AMT_REGEX_ALL = "^-?(([1-9][0-9]{0,14})|([0]{1})|(([0]\\.\\d{1,}|[1-9][0-9]{0,14}\\.\\d{1,})))$";

    /**
     * 头尾全半角空格正则
     */
    public static final String SAPCE_REGEX = "^[　 ]+|[　 ]+$";

    /**
     * 访问来源
     */
    public static final String PC_DATE_FROM = "0";

    /**
     * 默认密码
     */
    public static final String PASSWORD = "123456";

    /**
     * 英文括号
     */
    public static final String BRACKETSONE = "(";

    /**
     * 英文括号
     */
    public static final String BRACKETSTWO = ")";

    /**
     * 中文括号
     */
    public static final String BRACKETSTHREE = "（";

    /**
     * 中文括号
     */
    public static final String BRACKETSFOUR = "）";

    /**
     * 合同code前缀
     */
    public static final String CONTRACTCODE = "CESIHT-DCMM";

    /**
     * 项目线索code前缀
     */
    public static final String CULESCODE = "CESIXS-DCMM";
}
